<script setup>
import { defineProps, defineEmits } from 'vue'

defineProps({
  items: { type: Array, default: () => [] },
})

const emit = defineEmits(['toggle', 'delete', 'update'])
</script>

<template>
  <ul class="list">
    <TodoItem
      v-for="it in items"
      :key="it.id"
      :item="it"
      @toggle="id => emit('toggle', id)"
      @delete="id => emit('delete', id)"
      @update="p => emit('update', p)"
    />
  </ul>
</template>

<style scoped>
.list { list-style: none; margin: 12px 0 0; padding: 0; }
</style>


